<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">   
    <title>增加角色</title>
    <script type="text/javascript" src="<%=basePath%>/js/jquery-1.11.1.min.js"></script>
    <script type="text/javascript">
     $(document).ready(function(){
    	$("#roleid").attr("disabled", "disabled");
    	$("addUser").click(function(){
    		$.ajax({
    			data:$("#roleForm").serializeArray(),
    			url:"saveRole.do",
    			dataType:"JSON",
    			type:"POST",
    			success:function(result){
    				if(result.success){
    				alert("增加成功");
    				}
    				
    			}
    		});
    	});
    });  
    </script>
  </head> 
  <body>
     <form name="roleForm" id="roleForm" action="saveRole.do" method="post">
		<input type="hidden" name="roleid" id="roleid"/>
	<table border="0" cellpadding="0" cellspacing="2">
		<tr>
			<th>角色名称:</th>
			<td><input type="text" name="rolename"/></td>
		</tr>
		<tr>
			<th>角色描述:</th>
			<td><input type="text" name="des"/></td>
		</tr>
		<tr>
			<td>
				<button id="addRole" >增加角色</button>
			</td>
		</tr>
	</table>
	</form>
  </body>
</html>
